<?php

namespace app\company\validate;

use think\Validate;

class DealerValidate extends Validate
{
    protected $rule = [
            'name'     => 'require|max:20|unique:dealer',
            'contact'  => 'require|max:20',
            'phone'    => 'require|max:20',
            'address'  => 'require|max:20',
            'password' => 'require',
    ];

    protected $message = [
            'name.require'    => '经销商名称',
            'name.unique'     => '经销商名称已存在',
            'contact.require' => '负责人不能为空',
            'phone.require'   => '联系电话不能为空',
            'address.require' => '地址不能为空',


            'password.require'   => '密码不能为空',
            'repassword.require' => '确认密码不能为空',
            'repassword.confirm' => '两次输入的密码不一致',
    ];

    protected $scene = [
            'add'      => ['name', 'contact', 'phone', 'address'],
            'password' => ['password', 'repassword'],
    ];
}